#pragma once
#include <vector>

using std::vector;

struct Point {
	double x, y;
	bool operator != (const Point &p) const {
		return (x != p.x) || (y != p.y);
	}

	bool operator == (const Point &p) const {
		return !this->operator !=(p);
	}
};

typedef std::vector<Point> Points;

Point getMaxX(const Points &points) {
	Point res = points[0];
	size_t s = points.size();
	for (size_t i = 1; i < s; i++) {
		if (res.x < points[i].x)
			res = points[i];
	}
	return res;
}

Point getMinX(const Points &points) {
	Point res = points[0];
	size_t s = points.size();
	for (size_t i = 1; i < s; i++) {
		if (res.x > points[i].x)
			res = points[i];
	}
	return res;
}

double cross_product(const Point &start, const Point &end1, const Point &end2) {
	return ((end1.x-start.x)*(end2.y-start.y)-(end2.x-start.x)*(end1.y-start.y)); 
}